import { createRouter,createWebHashHistory } from 'vue-router'

const routes = [
  // 设置默认路由
  {
    path: '/',
    component: () => import ('../pages/home/Home.vue')
  },
  {
    path: '/home',
    component: () => import ('../pages/home/Home.vue')
  },
  {
    path: '/crat',
    component: () => import ('../pages/cart/Cart.vue')
  },
  {
    path: '/order',
    component: () => import ('../pages/order/Order.vue')
  },
  {
    path: '/mine',
    component: () => import ('../pages/mine/Mine.vue')
  }
]

const router = createRouter({
  // 设置路由映射关系，抽离出去
  routes,
  // 设置路由模式
  history: createWebHashHistory()
})

export default router